<!--
 * @Description: 裁切记录明细
 * 
 * @Author: Edan<Edan>
 * @Date: 2024-07-19 09:49:19
 * @FilePath: /yuxiuproweb/src/views/qb/cutRecode/mods/add.vue
-->

<template>
  <el-dialog
    :close-on-click-modal="false"
    :title="'裁切明细'"
    :visible.sync="shows"
    width="1000px"
    append-to-body
  >
    <!-- direction="vertical" -->
    <el-descriptions
      border
      :column="2"
      :size="'medium'"
      :label-style="label_style"
      :contentStyle="content_style"
    >
      <el-descriptions-item label="工单号" label-class-name="myLabel">
        <span>{{ form.workOrderNumber }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="订单号" label-class-name="myLabel">
        <span>{{ form.number }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="客户" label-class-name="myLabel">
        <span>{{ form.clientName }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="卷号" label-class-name="myLabel">
        <span>{{ form.oid }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="型号" label-class-name="myLabel">
        <span>{{ form.modelNumber }}</span>
      </el-descriptions-item>

      <el-descriptions-item label="批号" label-class-name="myLabel">
        <span>{{ form.batchNumber }}</span>
      </el-descriptions-item>

      <el-descriptions-item label="订单尺寸" label-class-name="myLabel">
        <span>{{ form.taskLength }}</span>
      </el-descriptions-item>
      <el-descriptions-item
        label="裁切米数"
        label-class-name="myLabel operateLabel"
        contentClassName="operateLabel"
      >
        <el-input v-model="form.length" placeholder="请输入内容" type="input" />
      </el-descriptions-item>
      <el-descriptions-item label="门幅" label-class-name="myLabel">
        <span>{{ form.height }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="工艺" label-class-name="myLabel">
        <span v-if="form.technology == 0">冷胶</span>
        <span v-else-if="form.technology == 1">热胶</span>
        <span v-else-if="form.technology == 3">先冷后热</span>
        <span v-else>无工艺</span>
      </el-descriptions-item>

      <el-descriptions-item label="裁切时间" label-class-name="myLabel">
        <span>{{ form.cuttingDate }}</span>
      </el-descriptions-item>

      <el-descriptions-item
        label="订单备注"
        label-class-name="myLabel"
        :span="2"
      >
        <span>{{ form.remarks }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="批号" label-class-name="myLabel">
        <span>{{ form.batchNumber }}</span>
      </el-descriptions-item>
      <el-descriptions-item label="操作" label-class-name="myLabel">
        <!-- operateBtnGroup-->
        <div class="">
          <el-button type="success" @click="submitForm">保存</el-button>
          <el-button @click="shows = false">关闭</el-button>
        </div>
      </el-descriptions-item>
    </el-descriptions>
    <!--  -->
  </el-dialog>
</template>

<script>
import { updateCuttingRecordsItem } from "@/api/qb/cutRecode";
import { getAddressList } from "@/api/transport/shipAddress";
import { listCompany } from "@/api/transport/logistics";
export default {
  components: {},
  props: {
    show: Boolean,
    data: {
      type: Object,
    },
  },
  data() {
    return {
      // 表单参数
      form: {},
      list: [],
      deliveryMethod: "",
      selInventoryRow: {},
      companyList: [],
      addressList: [],
      label_style: {
        "text-align": "center", //文本居中
        "font-weight": "600",
        width: "140px",
        "word-break": "keep-all",
        padding: "6px",
      },
      content_style: {
        "min-width": "200px",
        "word-break": "break-all", //过长时自动换行
        "font-size": "16px",
      },
    };
  },
  computed: {
    shows: {
      get() {
        return this.show;
      },
      set(newValue) {
        this.$emit("update:show", newValue);
      },
    },
  },
  async mounted() {
    this.getList();
  },
  methods: {
    getList() {
      this.form = Object.assign({}, this.data);
      console.log("form", this.form);
    },
    /** 提交按钮 */
    submitForm() {
      console.log(this.form);
      updateCuttingRecordsItem(this.form).then((res) => {
        this.$modal.msgSuccess(res.msg || "修改成功");
        this.shows = false;
        this.$emit("update");
      });
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep {
  .el-form-item {
    input {
      text-align: left;
    }
  }
}
.open-right {
  ::v-deep {
    .el-form-item {
      margin-bottom: 0;
    }
  }
}
::v-deep .myLabel {
  font-weight: bold;
  font-size: 16px;
  color: #515a6e;
}
::v-deep .operateLabel {
  background: #faecd8;
  //e1f3d8 faecd8 79bbff
}
.operateBtnGroup {
  display: flex;
  flex-wrap: wrap;
  div {
    margin-bottom: 10px;
    margin-right: 10px;
  }
}
::v-deep .el-dialog__body {
  padding: 10px 20px 20px 20px !important;
}
</style>
